<style type="text/css">
.carousel-inner .item img{
	max-width: 100%;
    max-height: 100%;
    vertical-align: middle;
	height:82px;
}
.star-rate {margin-left:0}
.fe-floatright-bottom a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #ff9999;
    color: #fff;
    line-height: 0.7rem;
	font-size:0.45rem;
    margin: 0.5rem auto;
    margin-right: 0;
}
.fe-floatright-bottom a .icon {
    color: #fff;
    font-size: 0.6rem;
    height: 0.6rem;
	line-height: 1rem;
    opacity: 1;
}
.btn.btn-success-o{
    background: #fff;
    border: 1px solid red;
    color: #333;
}
.btn.btn-success-o.active{
    background: #fdb2b2;
    border: 1px solid red;
    color: red;
}
.btn.btn-success-o.active .subtitle{
    color: red;
}
.btn.btn-success-o.active::after{content:" ";width:23px;height:24px;background:url(../core/resource/images/gou-red.png) no-repeat;position:absolute;float:right;right:-1px;bottom:-1px;text-align:center;}
.jy-image-typetitle {
    float: right;
    top: 0.3rem;
    left: 0.2rem;
    padding: 2px 6px;
    position: absolute;
    color: #fff;
    background: #f60;
    font-size: 12px;
    border-bottom-right-radius: 16px;
	border-top-left-radius: 16px;
    z-index: 3;
}
</style>

<div class="fui-page-group ">
<div class="fui-page fui-page-current page-goods-list">
	<div class='fui-content' style="background:#fff">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
				<div class="carousel-inner" role="listbox" style="height:6rem">
				<div>
					<a href="#">
						<img src="{{tomedia(pagedata.lesson.image) || '../addons/jy_edu/resource/images/mobile-hdp01.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
				</div>
		</div>
		<div class="weui_cells_title bold">{{pagedata.lesson.title}}</div>
		<div class="bd">
			<div class="weui_cells_title">课程简介</div>
			<div class="weui_cells">
				<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>{{pagedata.lesson.description || '该课程还没有添加简介！'}}</span>
					</div>           
				</div>
			</div>
		</div>
		<div class="bd">
			<div class="weui_cells_title">课程介绍</div>
			<div class="weui_cells">
				<div ng-if="pagedata.lesson.content" class="content-images" ng-bind-html="trust(pagedata.lesson.content)"></div>
			</div>
		</div>
		<div style="height:2.5rem;"></div>
	</div>
	<div class="fui-navbar">
		<a href="javascript:;" ng-click="access_json('jy_edu/book//isfee=1&lessonid='+pagedata.lesson.id)"  class="nav-item btn cartbtn">约课试听</a>
		<a href="javascript:;" ng-click="pagedata.checkbuy();" class="nav-item btn" style="background:#4491F1">购买课程</a>
	</div>
</div>
<div ng-if="pagedata.showtaocan" class="popup">
	<div class="popup-body">
		<div class="popup-bottom" style="height:18rem;overflow-y:scroll">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showtaocan=false"></i>
			<div style="padding:0 0.5rem">
			<div style="padding:0.2rem;padding-top:1rem">
			<div class='bold' style="font-size:1rem">选择课时套餐</div>
			</div>
			<div class="fui-icon-group noborder col-3" style="margin-top:0.5rem">
				<div ng-repeat="item in pagedata.lesson.taocan" ng-click="pagedata.taocankey=$index" class="fui-icon-col-sm" style="margin:0;padding:0 0.2rem;padding-top:1rem">
						<div ng-class="{'btn btn-success-o':1,'active':pagedata.taocankey==$index}" style="line-height:1.4;margin:0;padding:1rem 0.3rem;width:100%">
						<div class="subtitle">{{item.times}}课时</div>
						<div class="bold" style="font-size:1.3rem;">￥{{item.price}}</div>
						</div>
						<div ng-if="item.oldprice >0" class="jy-image-typetitle">原价￥{{item.oldprice}}</div>
				</div>
			</div>
			<div style="padding:0 0.5rem">
				<a href="javascript:;" class='weui_btn weui_btn_primary' style="background:red;border-radius:1rem;line-height: 3;margin-top:1.5rem" ng-click="pagedata.checkbuy(pagedata.taocankey,1)">确认购买</a>
			</div>
			<div class='red' style="font-size:0.6rem;padding:0 0.5rem;">购买提醒:1、选择不同的课时套餐，得相应的课时数；</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	}); 
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.pagedata.checkbuy=function(taocankey,tobuy){
	var taocankey=taocankey?taocankey:0;
	if(scope.pagedata.lesson.istimes==2 && !tobuy){
		scope.pagedata.showtaocan=true;
		scope.$evalAsync();
	}else{
		scope.access_json('jy_edu/create//taocankey='+taocankey+'&storeid='+scope.pagedata.lesson.storeid+'&classid='+scope.pagedata.lesson.classid+'&lessonid='+scope.pagedata.lesson.id);
	}
}
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>